package edu.tjut.tjutcommunity.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author yhh
 * @since 2022-04-14
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "User对象", description = "")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;
    @JsonIgnore
    @ApiModelProperty(value = "同学id")
    @TableId(value = "uid", type = IdType.AUTO)
    private Integer uid;

    @ApiModelProperty(value = "同学昵称")
    private String username;

    @ApiModelProperty(value = "学号")
    private String studentId;
    @JsonIgnore
    @ApiModelProperty(value = "学院代码")
    private Integer academyId;

    @ApiModelProperty(value = "学院名称")
    private String academyName;

    @ApiModelProperty(value = "用户已读消息id")
    private String messageId;
    @JsonIgnore
    private String prefList;

    @JsonIgnore
    @ApiModelProperty(value = "逻辑删除")
    @TableLogic
    private Integer deleted;

    @JsonIgnore
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "上次在线时间")
    private Date lastOnlineTime;

    private Integer level; //0为普通用户，1为管理员用户，拥有部分权限

}
